package com.eonmind.common.provider.entity.ai;

import com.eonmind.common.contract.data.base.DbEntity;
import com.eonmind.common.contract.enums.DelEnum;
import com.eonmind.common.contract.timer.Timer;
import com.mongoplus.annotation.ID;
import com.mongoplus.annotation.collection.CollectionField;
import com.mongoplus.annotation.collection.CollectionName;
import com.mongoplus.annotation.index.MongoHashIndex;
import com.mongoplus.annotation.index.MongoIndex;
import com.mongoplus.annotation.index.MongoTextIndex;
import com.mongoplus.enums.IdTypeEnum;
import com.mongoplus.enums.TextLanguages;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.ToString;
import lombok.experimental.FieldNameConstants;
import org.springframework.util.MimeType;

import javax.print.attribute.standard.Media;
import java.util.ArrayList;
import java.util.List;

@Data
@CollectionName("aiChatMessage")
@MongoTextIndex(fields = {"text_content"})
@FieldNameConstants
@ToString
public class ChatMessage implements DbEntity {
    @ID(type = IdTypeEnum.AUTO)
    private Long id;

    @MongoHashIndex()
    private String conversationId;


    private String textContent;

    @MongoHashIndex()
    private String messageType;

    private List<MessageMedia> messageMediaList = new ArrayList<>();

    private Long createTime = Timer.currentTimestamp();

    private Long updateTime = Timer.currentTimestamp();

    private Integer del = DelEnum.UN_DEL.getCode();


}

@Data
@AllArgsConstructor
@ToString
class MessageMedia {
    private String id;
    private String mimeType;
    private Object data;
    private String name;
}
